package com.sservice.service.service;

import com.sservice.model.entity.AdvanceReceipt;
import com.sservice.model.vo.AdvanceReceiptVo;
import com.sservice.base.entity.dto.ListResult;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by suweiming on 2017/12/20.
 */

public interface IAdvanceReceiptService {

    int deleteByPrimaryKey(Integer id);

    int insert(AdvanceReceipt record);

    int insertSelective(AdvanceReceipt record);

    /**
     * 创建预收款单
     *
     * @param record
     * @return
     */
    Object createAdvanceReceipt(AdvanceReceipt record);

    ListResult<AdvanceReceiptVo> pageBy(AdvanceReceiptVo record);

    /***
     *  创建预付款单
     * @param record
     * @return
     */
    Object createAdvancePay(AdvanceReceipt record);

    /**
     * 删除违背良心占用的预付/收款单
     * @param record
     * @return
     */
    Object destoryAdvancePay(AdvanceReceipt record);

    public Object delete(AdvanceReceipt record);

    /***
     * 付款单支付订单请款
     * @param record
     * @return
     */
    List<AdvanceReceiptVo> payedToOrder(AdvanceReceipt record);


    AdvanceReceipt selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AdvanceReceipt record);

    int updateByPrimaryKey(AdvanceReceipt record);

    /**
     * 符合查询条件统计
     *
     * @param record 查询条件
     * @return
     */
    int queryCount(AdvanceReceiptVo record);

    /**
     * 符合查询条件的AdvanceReceiptVo
     *
     * @param record 查询条件
     * @return
     */
    List<AdvanceReceiptVo> queryByPage(AdvanceReceiptVo record);


    /**
     * 截止目前，当前预收款单量
     *
     * @return
     */
    int queryCurrentDayCount(AdvanceReceipt ar);

    /***
     * 查询客户预收款单
     * @param record
     * @return
     */
    List<AdvanceReceiptVo> queryByClienteleId(AdvanceReceiptVo record);

    /**
     * 锁定预付款单
     *
     * @param record
     * @return
     */
    Object lockAdvanceBill(AdvanceReceiptVo record);


    /**
     * 批量付款更新
     *
     * @param record
     * @return
     */
    int updateAdvanceReceiptInBatch(List<AdvanceReceipt> record);

    /***
     * 核算锁定
     * @param record
     * @return
     */
    int lockAdvanceReceiptInBatch(List<AdvanceReceipt> record);

    /***
     * 释放锁定
     * @param record
     * @return
     */
    int releaseLockedAdvanceBill(AdvanceReceipt record);

    /**
     *   付款单金额变化
     * @param id
     * @param totalVerified  消费金额,: 负数表示回退，正数表示消费
     * @return
     */
    public int changeNumber(Integer id, BigDecimal totalVerified);



    }
